

function numDecodings(s){
    let len = s.length
    const arr = new Array(len).fill(0)
    arr[0] = 1
    for(let i=1; i<len; i++){
        if(arr[i-1] != '0'){  //01时，arr[1] = 0 001时，
            arr[i] += arr[i-1]
        }
        if(i > 1 && arr[i-2] != '0' && arr[i-2] * 10 + arr[i-1] * 1 <= 26){
            arr[i] += arr[i-2]
        }
        
    }
    console.log(arr)
}

const s = "2262"
numDecodings(s)